package com.burstly.lib.component.networkcomponent.burstly.html.mraid;

final class MraidViewState
{
  static final int DEFAULT_MASK = 2;
  static final int EXPANDED_MASK = 4;
  static final int HIDDEN_MASK = 1;
  static final int LOADING_MASK = 8;
  static final int RESIZED_MASK = 16;
  private int mAfterLoadingStateMask = 2;
  private int mState = 0;

  MraidViewState()
  {
    setFlag(8);
    setHidden(false);
  }

  private boolean hasFlag(int paramInt)
  {
    return (paramInt & this.mState) != 0;
  }

  private void resetFlag(int paramInt)
  {
    this.mState &= (paramInt ^ 0xFFFFFFFF);
  }

  private void setFlag(int paramInt)
  {
    this.mState = (paramInt | this.mState);
  }

  int getAfterLoadingStateMask()
  {
    return this.mAfterLoadingStateMask;
  }

  MraidBridgeState getState()
  {
    if (hasFlag(1))
      return MraidBridgeState.HIDDEN;
    if (hasFlag(4))
      return MraidBridgeState.EXPANDED;
    if (hasFlag(2))
      return MraidBridgeState.DEFAULT;
    if (hasFlag(16))
      return MraidBridgeState.RESIZED;
    return MraidBridgeState.LOADING;
  }

  boolean isHidden()
  {
    return !hasFlag(1);
  }

  void onPageLoaded()
  {
    if (hasFlag(8))
    {
      resetFlag(8);
      setFlag(this.mAfterLoadingStateMask);
    }
  }

  void setAfterLoadingStateMask(int paramInt)
  {
    this.mAfterLoadingStateMask = paramInt;
  }

  void setHidden(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      setFlag(1);
      return;
    }
    resetFlag(1);
  }

  void setState(MraidBridgeState paramMraidBridgeState)
  {
    if (paramMraidBridgeState == MraidBridgeState.HIDDEN)
    {
      setHidden(true);
      return;
    }
    this.mState = 0;
    if (paramMraidBridgeState == MraidBridgeState.EXPANDED)
    {
      setFlag(4);
      return;
    }
    if (paramMraidBridgeState == MraidBridgeState.DEFAULT)
    {
      setFlag(2);
      return;
    }
    if (paramMraidBridgeState == MraidBridgeState.RESIZED)
    {
      setFlag(16);
      return;
    }
    setFlag(8);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.mraid.MraidViewState
 * JD-Core Version:    0.6.2
 */